<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        /* 中间自适应，上下固定宽高 */
        html,
        body {
            width: 100%;
            height: 100%;
            padding: 0;
            margin: 0;

        }

        .root {
            margin: 0 auto;
            width: 500px;
            display: flex;
            height: 100%;
            /* 上下排序 */
            flex-direction: column;

        }

        .root div {
            width: 500px;
            border: 1px solid pink;
        }

        .one {
            width: 500px;
            height: 50px;

        }

        .two {
            width: 500px;
            flex-grow: 1;
        }

        .tree {
            width: 200px;
            height: 60px;
        }
    </style>


</head>

<body>
    <!-- 1和3固定高中间自适应 -->
    <div class="root">
        <div class="one">1</div>
        <div class="two">2</div>
        <div class="tree">3</div>
    </div>
</body>

</html>